using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Shpm.App.Commons.Db.Beans.Master;
using Shpm.System.Auth.Dao;
using Shpm.System;
using Shpm.App.Commons.Db.Beans.Inp;

public partial class App_Commons_PassForm : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnLogon_Click(object sender, EventArgs e)
    {
        if (this.ComValidator1.DoValidator() == false)
        {

            ((Design_MasterPage)this.Master).InfoMessage = this.ComValidator1.ErrorMessage;

            return;
        }
        if (TextBox1.Text != TextBox2.Text)
        {
            ((Design_MasterPage)this.Master).InfoMessage =
                       HttpContext.GetGlobalResourceObject(Constants.GLOBAL_RESOURCE_NAME, "I0044").ToString();
            return;
        }
        SysUserManager manager = new SysUserManager(Context);
        string userId = manager.getSysUserBean().getMstSysUserBean().SysUserId;
        MstSysUserBean dataBean = new MstSysUserBean();
        dataBean.PassWd = txtPassWD.Text;
        dataBean.NPassWd = this.TextBox1.Text;
        dataBean.SysUserId = userId;
        LogonDao Dao = new LogonDao();
        int i = 0;
        i = Dao.UpdPw(dataBean);
        if (i == 0)
        {
            ((Design_MasterPage)this.Master).InfoMessage =
                       HttpContext.GetGlobalResourceObject(Constants.GLOBAL_RESOURCE_NAME, "I0045").ToString();
        }
        else
        {
            ((Design_MasterPage)this.Master).InfoMessage =
                       HttpContext.GetGlobalResourceObject(Constants.GLOBAL_RESOURCE_NAME, "I0002").ToString();
        }
    }

}
